﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ninject;

namespace CoolCode.Ioc
{
    /// <summary>
    /// 可挖掘的
    /// </summary>
    public interface  IDiggable
    {
        /// <summary>
        /// 挖掘
        /// </summary>
        /// <typeparam name="T">注入的类型</typeparam>
        /// <returns></returns>
        T Dig<T>();
    }

    class Digger:IDiggable 
    {
        private IKernel Inner;

        public Digger(IKernel kernel)
        {
            Inner = kernel;
        }

        #region IDiggable Members

        public T Dig<T>()
        {
            return Inner.Get<T>();
        }

        #endregion
    }
}
